package com.ttt.gdfood.service;

import com.ttt.gdfood.entity.Contact;
import com.ttt.gdfood.mapper.ContactMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ContactService {
    @Autowired
    ContactMapper contactMapper;

    // 根据用户id查找
    public List<Contact> getContact(int uid){
        return contactMapper.getContact(uid);
    }

    // 根据联系人id删除
    public void delContactById(int contact_id){
        contactMapper.delContactById(contact_id);
    }

    // 根据被关注人id删除
    public void delContactByCid(int cid){
        contactMapper.delContactByCid(cid);
    }

    // 添加联系人
    public void insertContact(int uid,int cid) {
        contactMapper.insertContact(uid,cid);
    }
}
